<template>
	<view class="movie-page page" v-if="info">
		<!-- 预告片 -->
		<view class="player">
			<video 
			id="myMovie"
			class="movie"
			:src="info.trailer"
			:poster="info.poster"
			controls
			></video>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		// #ifndef MP-ALIPAY || MP-TOUTIAO
		// 页面初次渲染
		onReady() {
			// 创建视频上下文
			this.videoContext = uni.createVideoContext('myMovie')
			uni.showLoading({
				title: '加载中'
			})
		},
		onHide() {
			// 页面隐藏时 暂停播放
			this.videoContext.pause()
		},
		onShow() {
			// 再次显示继续播放
			this.videoContext && this.videoContext.play()
		},
		// #endif
		methods: {
			
		}
	}
</script>

<style lang="scss">
.movie-page{
	.player{
		display: flex;
		justify-content: center;
		background-color: black;
		.movie{
			width: 100%;
			height: 440upx;
		}
	}
}	
</style>
